from random import random

num0 = 4486.0
num1 = 506.0

prob = num1/num0

f = open('first_999_36_features.txt', 'r')
out = open('first_double-biased_equal.txt', 'w')
for l in f:
  if l.startswith('1'):
    out.write(l)
  else:
    if random() < prob:
      out.write(l)
